import request from '@/utils/request'

// 查询司机列表
export function listDriver(query) {
  return request({
    url: '/didi-driver/didi-driver/list',
    method: 'get',
    params: query
  })
}

// 查询司机详细
export function getDriver(id) {
  return request({
    url: '/didi-driver/didi-driver/' + id,
    method: 'get'
  })
}

// 新增司机
export function addDriver(data) {
  return request({
    url: '/didi-driver/didi-driver',
    method: 'post',
    data: data
  })
}

// 修改司机
export function updateDriver(data) {
  return request({
    url: '/didi-driver/didi-driver',
    method: 'put',
    data: data
  })
}

// 删除司机
export function delDriver(id) {
  return request({
    url: '/didi-driver/didi-driver/' + id,
    method: 'delete'
  })
}

export function getLevelDetail(id) {
  return request({
    url: '/didi-driver/didi-driver/level/' + id,
    method: 'get'
  })
}

export function getDriverOrderList(driverId) {
  return request({
    url: '/didi-order/order/selectOrderVoById/',
    method: 'get',
    params: { 
      id: driverId,
      field: 'driver_id'
    }
  })
}
